package com.ds.msg.mqtt.client;

import com.ds.common.JDSException;
import com.ds.server.JDSClientService;

import java.util.HashMap;
import java.util.Map;

public class JMQClientFactory {
    static Map<JDSClientService, JMQClient> clientMap = new HashMap<JDSClientService, JMQClient>();

    public static JMQClient getJMQClient(JDSClientService client) throws JDSException {
        JMQClient jmqClientService = clientMap.get(client);
        if (jmqClientService == null) {
            jmqClientService = new JMQClientImpl(client);
            clientMap.put(client, jmqClientService);
        }
        return jmqClientService;
    }
}
